package cn.lkk.samples.lang.thread.create;

/**
 * 继承Thread方法创建一个线程
 */
public class NewThread_Extend {
    public static void main(String[] args) {
        Thread thread = new Runner2();
        thread.start();

        for (int i = 0; i < 100; ++i) {
            System.out.println("Main.run(" + i + ")");
        }
    }
}

class Runner2 extends Thread {

    @Override
    public void run() {
        for (int i = 0; i < 100; ++i) {
            System.out.println("Runner.run(" + i + ")");
        }
    }
}
